import request from '@/utils/request'

//对应后端查询菜单列表接口
export const GetMenuList = ()=>{
    return request({
        url:`/admin/system/sysMenu/menuList`,
        method:'get'
    })
}

//对应后端添加菜单接口
export const AddMenu = (sysMenu)=>{
    return request({
        url:`/admin/system/sysMenu/addMenu`,
        method:'post',
        data:sysMenu
    })
}

//对应后端删除菜单接口
export const DeleteMenu = (sysMenuId)=>{
    return request({
        url:`/admin/system/sysMenu/deleteMenu/${sysMenuId}`,
        method:'delete',
    })
}

//对应后端删除菜单接口
export const UpdateMenu = (sysMenu)=>{
    return request({
        url:`/admin/system/sysMenu/updateMenu`,
        method:'post',
        data:sysMenu
    })
}

//对应后端的查询菜单列表和菜单id列表
export const GetMenuListAndMenuIdList = (roleId)=>{
    return request({
        url:`/admin/system/sysMenu/getMenuListAndMenuIdList/${roleId}`,
        method:'get',
        // data:xxx  后端接口有@RequestBody
        // params:'' 后端接口没有@RequestBody
    })
}   

//对应后端的为角色分配菜单接口
export const DoAssignMenu = (menuDto)=>{
    return request({
        url:`/admin/system/sysMenu/doAssignMenu`,
        method:'post',
        data:menuDto
    })
}   